Unit 3 Exercise 14
Exercise 14: Events: Failure Criteria
Objective
To utilize Advance Failure Criteria so that if a job fails with a 100, SAM will mark the completed job as Finished OK and trigger an Event based off the Exit Code of 100.
Summary
Using the existing Schedule Exit Code Events, you will modify Job 1 and set Failure Criteria to:
Finish OK if Equal to 0
OR Finish OK if Equal to 100
You will also add a new Event triggered on Exit Description of 100 and will Skip JOB 2.
Instructions
Configure Advanced Failure Criteria
- Open Studio.
- In the Schedule list, select Exit Code Events.
- Click the View button.
- Select Job 1 within the Exit Code Events Schedule.
- Click the Wrench icon in the side menu.
- Click the Lock icon in the upper right-hand corner.
- In Task Details, scroll to Failure Criteria.
- In the first row, set the drop downs as follows:
=
,0
, andFinish OK
. - In the second row, set the drop downs as follows:
or
,=
, and100
.
Create the Skip Event
- Scroll to Events.
- Click Add.
- In the Create New Event pop-up window
- In the Send Event On drop down, select Exit Description.
- In the Comparison Operator dropdown, select Equal To.
- In the Value field, enter
100
. - In the Event Template drop down, select the $JOB:SKIP event.
- In the Schedule date field, use the Magic Wand or CTRL+SPACE to select $SCHEDULE DATE property.
- In the Schedule name field, use the Magic Wand or CTRL+SPACE to select $SCHEDULE NAME property.
- In the Job name field, enter
Job 2
. - Click the Save button.
- Click the Save button in the Master Job Definition.
Build the Schedule
- In Operations, click on Schedule Build.
- In the Schedule Date section, validate that today's date is specified for both From and To.
- Set the Schedule Build status to Released.
- Select Exit Code Events from the Schedule list.
- Click the Build button.
- Expand and click on the schedule link for Exit Code Events to return to the Processes screen.
note
When the schedule completes, you should notice that in the Return Code column for Job 1 shows a 100 but the job has Finished OK and Job 2 was skipped. Whereas, if you look at the Return Code column for the Job Failure job, it shows a 100. This is because the AFC isn't set for the Job Failure job.
- Close all open modules.